package dijiuzhou;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String str=null;
		int[] arr=new int[5];
		while(true)
		{
			String choice=sc.next();
			if(choice.equals("arr")){
				try{
					int index=sc.nextInt();
					arr[index]=1;
				}catch (ArrayIndexOutOfBoundsException e){	
				    System.out.println(e);
			    }
			}
			else if(choice.equals("null")){
				NullPointerException e=new NullPointerException();
				System.out.println(e);
			}
			else if(choice.equals("cast")){
				ClassCastException e = new ClassCastException("java.lang.String cannot be cast to java.lang.Integer");
				System.out.println(e);
			}
			else if(choice.equals("num")){
				try{
					int n=Integer.parseInt(sc.next());
				}catch (NumberFormatException e){
					System.out.println(e);
				}
			}
			else break;
		}
		sc.close();

	}

}